import QtQuick 1.0

Item {
    objectName: "fire"
    width: 100; height: 80

    Image {
        id: image1
        source: ":/images/fire1.png"
        opacity:  0
        width: 100; height: 80
    }

    Image {
        id: image2
        source: ":/images/fire2.png"
        opacity:  0
        width: 100; height: 80
    }

    Image {
        id: image3
        source: ":/images/fire3.png"
        opacity:  0
        width: 100; height: 80
    }

    Image {
        id: image4
        source: ":/images/fire4.png"
        opacity:  0
        width: 100; height: 80
    }

    SequentialAnimation {
        id: fire_animation
        property int dur : 100
        running: true
        loops: Animation.Infinite
        ParallelAnimation {
            NumberAnimation { target: image4; property: "opacity"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image1; property: "opacity"; to: 1; duration: fire_animation.dur }
            NumberAnimation { target: image4; property: "y"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image1; property: "y"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image4; property: "height"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image1; property: "height"; to: 80; duration: fire_animation.dur }
        }

        ParallelAnimation {
            NumberAnimation { target: image1; property: "opacity"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "opacity"; to: 1; duration: fire_animation.dur }
            NumberAnimation { target: image1; property: "y"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "y"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image1; property: "height"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "height"; to: 80; duration: fire_animation.dur }
        }

        ParallelAnimation {
            NumberAnimation { target: image2; property: "opacity"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image3; property: "opacity"; to: 1; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "y"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image3; property: "y"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "height"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image3; property: "height"; to: 80; duration: fire_animation.dur }
        }

        ParallelAnimation {
            NumberAnimation { target: image3; property: "opacity"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "opacity"; to: 1; duration: fire_animation.dur }
            NumberAnimation { target: image3; property: "y"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "y"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image3; property: "height"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "height"; to: 80; duration: fire_animation.dur }
        }

        ParallelAnimation {
            NumberAnimation { target: image2; property: "opacity"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image4; property: "opacity"; to: 1; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "y"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image4; property: "y"; to: 0; duration: fire_animation.dur }
            NumberAnimation { target: image2; property: "height"; to: 40; duration: fire_animation.dur }
            NumberAnimation { target: image4; property: "height"; to: 80; duration: fire_animation.dur }
        }
    }

}
